<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>

    // 父类
    class animal{
        constructor(){
            this.weight = '重量';
            this.color = '颜色';
        }
        move(){
            console.log('会动');
        }
    }

    // 子类
    // extends表示继承
    class fish extends animal{
        // fish类特有的方法
        moveabout(){
            console.log('能游动');
        }
    }

    let goldfish = new fish();
    console.log(goldfish.weight);


</script>


</body>
</html>